/*
 * @Author: your name
 * @Date: 2021-11-22 16:02:33
 * @LastEditTime: 2022-01-28 15:15:34
 * @LastEditors: your name
 * @Description: 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 * @FilePath: \agricultural-production-web\src\api\system-settings\environmental-data-test-record\index.js
 */
import xjaxios from "@/api/axios";
// import xjaxiosOnline from "@/api/axios";
export default {
  /**
     * @description: 获取表格
     * @return {Object}
     */
  getlist(params) {
    return xjaxios.post("/productionv2/dataMonitor/queryPageList", {
      ...params
    });
  },
  /**
     * @description: 新增
     * @return {Object}
     */
  addlist(params) {
    return xjaxios.post("/dataMonitor/add", {
      ...params
    });
  },
  /**
     * @description: 修改
     * @return {Object}
     */
  editlist(params) {
    return xjaxios.post("/dataMonitor/edit", {
      ...params
    });
  },
  /**
     * @description: 删除
     * @return {Object}
     */
  dellist(params) {
    return xjaxios.post("/dataMonitor/delList", {
      dataMonitorIdList: params
    });
  },
  /**
     * @description: 条件查询
     * @return {Object}
     */
  querybycondion(params) {
    return xjaxios.post("/dataMonitor/queryByCondition", {
      ...params
    });
  },
  /**
     * @description: 获取数据项
     * @return {Object}
     */
  getdataitem(param) {
    // return xjaxios.post("/sensorFacilityMapper/queryByCondition", {
    //   "category": "normal",
    //   "control": false,
    //   ...param
    // });
    return xjaxios.post('/v3/growth/collectDataItem/queryByCondition', {
      ...param
    });
  },
  /**
   * @description: 获取数据项
   * @return {Object}
   */
  getdataitems(params) {
    return xjaxios.post("v3/iot/dataItem/queryByCondition", {
      organizationNo: sessionStorage.organizationNo,
      // control: true,
      visible: true,
      facilityNo: params.facilityNo
    });
  },
  /**
   * @description: 获取数据项
   * @return {Object}
   */
  getdataFacilityitems(params) {
    return xjaxios.post("v3/iot/cameraFacilityMapper/queryByCondition", {
      organizationNo: sessionStorage.organizationNo,
      facilityNo: params.facilityNo
    });
  },
  /**
   * @description: 直接获取所有地块
   * @param {String} organizationtId
   * @return {Array}
   */
  getfacilityAll(params) {
    return xjaxios.post("/v3/facility/facility/queryByCondition", {
      organizationList: sessionStorage.organizationList,
      ...params
    })
  },
  /**
   * @description: 获取摄像头id
   * @param {String} organizationtId
   * @return {Array}
   */
  getcameraAll() {
    return xjaxios.post('v3/iot/camera/queryByCondition', {
      organizationNo: sessionStorage.organizationNo,
      farmingTypeNo: sessionStorage.farmingTypeNo
    })
    // return xjaxios.get(
    //   `/camera/queryByCompanyMark/${sessionStorage.getItem("organizationMark")}`
    // );
  }
}
